
import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Color;

public class ColorBoxes extends Applet
{
public void paint(Graphics g)
  {
  int rval,gval,bval;
  for(int j=5;j<getSize().height-25;j+=30)
    {
    for(int i=5;i<getSize().width-25;i+=30)
      {
      rval=(int)Math.floor(Math.random()*256);
      gval=(int)Math.floor(Math.random()*256);
      bval=(int)Math.floor(Math.random()*256);
      g.setColor(new Color(rval,gval,bval));
      g.fillRect(i,j,25,25);
      g.setColor(Color.black);
      g.drawRect(i-1,j-1,25,25);
      }
    }
  }
}

